<?php include("../conn.php");

    error_reporting(0);
    
    class MyBean{
		public $code;
		public $msg;
		public $result;

		function __construct($code,$msg,$result){
			$this->code      = $code;
			$this->msg      = $msg;
			$this->result      = $result;
			
		}
  }

   try{
	   	mysql_select_db('xzsh');
	     // 查询商家的运费模板
		$query = mysql_query("select id,name from fareml");
		while ($row = mysql_fetch_assoc($query)) {
			$fareml[] = $row;
		}

		// 查询商家的运费模板
	        $obj = new MyBean("200","查询成功",$fareml);
	        echo json_encode($obj);
    }
	//捕获异常
	catch(Exception $e)
	 {
	   $obj = new MyBean("201","查询失败");
	   echo json_encode($obj);
	 }

   
?>